//
//  CodeExample2.m
//  LSCodeLibrary
//
//  Created by Samuel on 15/4/2.
//  Copyright (c) 2015年 Samuel. All rights reserved.
//

#import "CodeExample2.h"

@implementation CodeExample2
//截屏代码
+ (UIImage*)caputure:(UIView*)view
{
    CGRect screenRect = [view bounds];
    UIGraphicsBeginImageContext(screenRect.size);
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    [view.layer renderInContext:ctx];
    UIImage *aaa = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return aaa;
}
@end
